
#ifndef _motor_h
#define _motor_h
#include "headfile.h"
#define SPEED_MAX  8000
#define DIR_R P60
#define PWM_R PWMA_CH2P_P62

#define DIR_L  P64
#define PWM_L  PWMA_CH4P_P66


#define PWM_SERVO   PWMB_CH1_P74
#define STEER_PIN PWMB_CH1_P74
#define STEER_MID 695
#define STEER_LEFT 780
#define STEER_RIGHT 610
#define LEFT_MAX  (STEER_LEFT- STEER_MID)
#define RIGHT_MAX (STEER_RIGHT-STEER_MID)



void motor_init(void);


void left_speed(int16 l_speed);
void right_speed(int16 r_speed);
void motor_speed(int16 L_speed,int16 R_speed);
void Steer(int Angle);














#endif